<?php global $user;?>
<div class="page">
    <div class="header">
        <div class="wrapper wrapper_header">
            <div class="logo">
                <a class="brand clear-tab"
                   href="<?php echo $base_path . 'home';?>"><?php echo $site_name;?></a>
            </div>
            <div class="main_menu">
                <?php if ($main_menu && $user->uid): ?>
                <div id="main-menu" class="navigation">
                    <?php print theme('links__system_main_menu', array(
                                                                      'links' => $main_menu,
                                                                      'attributes' => array(
                                                                          'id' => 'main-menu-links',
                                                                          'class' => array('links', 'clearfix'),
                                                                      ),
                                                                 )); ?>
                </div> <!-- /#main-menu -->
                <?php endif; ?>
            </div>
            <div class="second_menu">
                <ul>
                    <?php if ($user->uid > 0): ?>
                    <li>
                        <a href="<?php print $base_path . 'cart';?>">
                            <i class="icon-shopping-cart icon-white"></i>
                            <?php print !empty($_SESSION['cart']) ? count($_SESSION['cart']) : '0';?>
                        </a>
                    </li>
                    <li class="name">
                        <?php print l('Logged in as ' . '<span>' . $user->name . '<span>', 'user/' . $user->uid, array('html' => TRUE))?>
                    </li>
                    <li>
                        <?php print l('Sign Out', 'user/logout');?>
                    </li>
                    <?php else: ?>
                    <li>
                        <?php print l('Sign In', 'user/login');?>
                    </li>
                    <li>
                        <?php print l('Sign Up', 'user/register');?>
                    </li>
                    <?php endif;?>
                </ul>
            </div>
        </div>

        <div class="clearfix"></div>
    </div>
    <div class="container">
        <div class="wrapper wrapper_container">
            <?php if ($page['right_content'] && $user->uid > 0): ?>
            <div class="right_content">
                <?php print render($page['right_content'])?>
            </div>
            <?php endif;?>
            <div class="content_left">
                <?php if ($breadcrumb && $user->uid > 0): ?>
                <div id="breadcrumb"><?php print $breadcrumb; ?></div>
                <?php endif; ?>
                <?php if ($title): ?>
                <h1 class="title" id="page-title">
                    <?php print $title; ?>
                </h1>
                <?php endif; ?>
                <?php if ($messages): ?>
                <div id="messages">
                    <div class="section clearfix">
                        <?php print $messages; ?>
                    </div>
                </div> <!-- /.section, /#messages -->
                <?php endif; ?>
                <?php if ($tabs && (user_access('administrator') || ($user->uid > 0 && arg(0) == 'user') && is_numeric(arg(1)))): ?>
                <div class="tabs">
                    <?php print render($tabs); ?>
                </div>
                <?php endif; ?>
                <?php print render($page['content']); ?>
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
    <div class="footer">
        <div class="wrapper wrapper_footer">
            <div class="logo_footer">
                <?php print render($page['footer_left']);?>
            </div>
            <div class="center_footer">
                <?php print render($page['footer_middle']);?>
            </div>
            <div class="right_footer">
                <?php print render($page['footer_right']);?>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
</div>